<template>
  <Spin :spinning="loading" tip="Loading...">
    <div>
      <!-- table -->
      <div style="padding-top: 1rem"></div>
      <BreakSpace label="索赔结算单列表" :containerStyle="{ marginBottom: '10px' }" />
      <FilterTable
        ref="table"
        :columns="columns"
        :params="fetchParams"
        :dataSource="dataList"
        :datakey="'records'"
        :onColumnsChange="(columns) => (this.columns = columns)"
        :onCellChange="onCellChange"
        :isPagination="false"
        :isSelectColumn="false"
        height="auto"
        :is-select-column="false"
      >
        <template slot="controls" slot-scope="props">
<!--          <multiuse-button size="small" type="primary" icon="el-icon-plus" @click="jiesuandanadd()">添加</multiuse-button>-->
        </template>
      </FilterTable>
      <div style="padding-top: 3rem"></div>
      <BreakSpace label="发票信息维护" :containerStyle="{ marginBottom: '10px' }" />
      <FilterTable
        ref="tableInvoice"
        :columns="columns1"
        :params="fetchParams"
        :dataSource="dataList"
        :datakey="'records'"
        :onColumnsChange="(columns1) => (this.columns1 = columns1)"
        :onCellChange="onCellChange"
        :isPagination="false"
        :isSelectColumn="false"
        height="auto"
        :is-select-column="false"
      >
        <template slot="controls" slot-scope="props">
          <multiuse-button size="small" type="primary" icon="el-icon-plus" @click="addInvoice()">添加</multiuse-button>
        </template>
      </FilterTable>
      <!--发票form-->
      <div style="padding-top: 3rem"></div>
      <FormPanel ref="formPanel" :list="formList" :cols="1" :formType="'add'" labelWidth="110" :isSubmitBtn="false" @formChange="formChangeHandle" />
      <BreakSpace label="索赔单列表" :containerStyle="{ marginBottom: '10px' }" />
      <FilterTable
        ref="table2"
        :columns="columns2"
        :params="fetchParams"
        :dataSource="dataList"
        :datakey="'records'"
        :onColumnsChange="(columns) => (this.columns2 = columns2)"
        :onCellChange="onCellChange"
        :isPagination="false"
        :isSelectColumn="false"
        height="auto"
        :is-select-column="false"
      >
      </FilterTable>
      <div style="padding-top: 3rem"></div>
      <BreakSpace label="考核单列表" :containerStyle="{ marginBottom: '10px' }" />
      <FilterTable
        ref="table3"
        :columns="columns3"
        :params="fetchParams"
        :dataSource="dataList"
        :datakey="'records'"
        :onColumnsChange="(columns3) => (this.columns3 = columns3)"
        :onCellChange="onCellChange"
        :isPagination="false"
        :isSelectColumn="false"
        height="auto"
        :is-select-column="false"
      >
      </FilterTable>
      <div style="padding-top: 3rem"></div>
      <BreakSpace label="审核列表" :containerStyle="{ marginBottom: '10px' }" />
      <FilterTable
        ref="table4"
        :columns="columns4"
        :params="fetchParams"
        :dataSource="dataList"
        :datakey="'items'"
        :onColumnsChange="(columns) => (this.columns = columns)"
        :onRowSelectChange="selectChange"
        :isPagination="false"
        :isSelectColumn="false"
        height="auto"
        :is-select-column="false"
      >
      </FilterTable>
      <!--快递form-->
      <div style="padding-top: 3rem"></div>
      <FormPanel ref="formPanel1" :list="formList1" :cols="3" :formType="'add'" labelWidth="110" :isSubmitBtn="false" @formChange="formChangeHandle1" />
      <div style="padding-top: 3rem"></div>
      <div style="padding-top: 3rem"></div>
      <div
        :style="{
          position: 'fixed',
          left: 0,
          bottom: 0,
          right: 0,
          zIndex: 9,
          borderTop: '1px solid #e9e9e9',
          padding: '10px 20px',
          background: '#fff',
          textAlign: 'right',
        }"
      >
        <multiuse-button type="primary" :click="saveDialog.bind()">保 存</multiuse-button>
        <multiuse-button @click="closeDialog">关 闭</multiuse-button>
      </div>
      <BaseDialog :visible.sync="jiesuandanFlag" :title="'结算单选择'" destroyOnClose width="850px" :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
        <SelectClaimStatement @close="jiesuandanClose" @save="jiesuandanSave"></SelectClaimStatement>
      </BaseDialog>
      <BaseDialog :visible.sync="invoiceShow" :title="'添加发票'" destroyOnClose width="850px" :containerStyle="{ height: 'calc(100% - 60px)', overflow: 'auto', paddingBottom: '60px' }">
        <addInvoice @close="closeAddInvoice" @save="saveAddInvoice" :invoiceList="invoiceList"></addInvoice>
      </BaseDialog>
    </div>
  </Spin>
</template>
<script>
import addInvoice from './addInvoice.vue';
//索赔结算单选择
import SelectClaimStatement from './SelectClaimStatement.vue';
//选择结算单之后回带索赔单和考核单信息
import { isFormEmpty } from '@/utils/index';
import { SelectClaimBySettleIds, SelectAssesBySettleIds, editSave, quyrpBatch } from '@/api/claim/dealer/InvoiceManage';
import { BasicParametersAfterSales } from '@/api/dictionary/index';
export default {
  props: ['rowData'],
  components: {
    addInvoice,
    SelectClaimStatement,
  },
  data() {
    return {
      loading: false,
      kaohedanMoney: 0,
      suopeidanMoney: 0,
      jiesuandanMoney: 0,
      kaipiaozongMoney: 0,
      countfapiaoShu: 0,
      jine: 0,
      shuie: 0,
      kaipiaoshuilv: 0,
      editRow: {},
      dataList: [],
      dataList1: [],
      visible: false,
      jiesuandanFlag: false,
      visibleDrawer: false,
      collapse: false,
      infoId: null,
      flterValue: {}, //参数
      columns: this.creatHeader(),
      columns1: this.creatHeader1(),
      columns2: this.creatHeader2(),
      columns3: this.creatHeader3(),
      columns4: this.creatHeader4(),
      fetchParams: {}, //ipa 接口
      selectedRows: [], //选中经销商
      formList: this.createFormList(),
      formList1: this.createFormList1(),
      saveData: null,
      activeName: '审核记录',
      saveData1: {},
      invoiceShow: false,
      delInvoiceIds: '',
      oldInvoiceArr: [],
      invoiceList: [],
      invoiceMax: 0,
    };
  },
  async created() {
    this.loading = true;
    await this.getDetailFun(this.rowData.batchId);
    let res = await BasicParametersAfterSales();
    this.invoiceMax = res.data[2001];
    this.loading = false;
  },
  methods: {
    //保存
    async saveDialog() {
      this.$refs.formPanel.SUBMIT_FORM();
      this.$refs.formPanel1.SUBMIT_FORM();
      if (JSON.stringify(this.saveData1) != '{}') {
        let settleIds = '';
        this.$refs.table.$refs.pageTable.list.map((x) => {
          settleIds += x.settleId + ',';
        });
        this.saveData.settleIds = settleIds;
        this.saveData = Object.assign(this.saveData, this.saveData1);
        let arr = [];
        this.$refs.tableInvoice.$refs.pageTable.list.map((x) => {
          x.settleAmount = x.invoiceMoney;
          x.invoiceAmount = x.invoiceAmout;
          arr.push(x);
        });
        //发票table
        this.saveData.invoiceList = arr;
        //新增之前汇总各种钱数
        let jiesuandanMoney = 0; //结算单金额
        let suopeidanMoney = 0; //索赔单金额
        let kaohedanMoney = 0; //考核单金额
        let labourAmount = 0;
        let partAmount = 0;
        let addAmount = 0;
        let priceAmount = 0;
        this.$refs.table.$refs.pageTable.list.map((x) => {
          jiesuandanMoney += x.settleAmount;
          suopeidanMoney += x.claimAmount;
          kaohedanMoney += x.assessAmount;
        });
        this.$refs.table2.$refs.pageTable.list.map((x) => {
          if(x.ifPrice=='否'){
            labourAmount +=x.labourFinalPrice;
            partAmount +=x.partrFinalPrice;
            addAmount +=x.addFinalPrice;
          }else{
            priceAmount += x.finalSumAmount;
          }

        });
        this.saveData.labourAmount=labourAmount;
        this.saveData.partAmount=partAmount;
        this.saveData.addAmount=addAmount;
        this.saveData.priceAmount=priceAmount;
        let kaipiaozongMoney = 0; //开票总金额
        let countfapiaoShu = 0; //发票数量
        let kaipiaoshuilv = 0; //开票税率
        let shuie = 0; //税额
        let jine = 0; //金额
        let newInvoiceIds = [];
        this.$refs.tableInvoice.$refs.pageTable.list.map((x) => {
          kaipiaozongMoney += Number(x.invoiceAmout);
          countfapiaoShu = countfapiaoShu + 1;
          kaipiaoshuilv = x.taxRate;
          shuie += Number(x.taxAmount);
          jine += Number(x.invoiceMoney);
          newInvoiceIds.push(x.invoiceId);
        });
        //结算单金额
        this.saveData.settleSum = jiesuandanMoney;
        //考核单金额
        this.saveData.assessSum = kaohedanMoney;
        //索赔单金额
        this.saveData.claimSum = suopeidanMoney;
        //开票总金额
        this.saveData.invoiceSum = kaipiaozongMoney;
        //发票张数
        this.saveData.invoiceSheets = countfapiaoShu;
        //金额
        this.saveData.invoiceMoney = jine;
        //税额
        this.saveData.invoicePointAmount = shuie;
        //开票税率
        this.saveData.invoicePoint = kaipiaoshuilv;
        this.saveData.batchStatus = 55481001;
        this.saveData.invoiceMax = this.invoiceMax;
        for (let a in this.editRow) {
          if (this.saveData[a]) {
            this.editRow[a] = this.saveData[a];
          }
        }

        this.oldInvoiceArr.map((x) => {
          if (!newInvoiceIds.find((y) => y == x)) {
            this.delInvoiceIds += x + ',';
          }
        });
        this.editRow.delInvoiceIds = this.delInvoiceIds;

        if (this.saveData.invoiceList.length && this.$refs.table.$refs.pageTable.list.length) {
          if (jiesuandanMoney.toFixed(2) != kaipiaozongMoney.toFixed(2)) {
            return this.$notify.error({ title: '提示信息', message: '结算金额总和不等于开票金额总和！' });
          }
          let falg = true;
          this.saveData.carType = this.$refs.table.$refs.pageTable.list[0].carType;
          let firstCarType = this.saveData.carType;
          this.$refs.table.$refs.pageTable.list.map((x) => {
            if (x.carType !== firstCarType) {
              falg = false;
            }
          });
          if (falg) {
            this.loading = true;
            let res = await editSave(this.editRow);
            if (res.resultCode === 200) {
              this.$emit('save');
              return this.$notify.success({ title: '提示信息', message: '保存成功' });
            }
            this.loading = false;
          } else {
            this.$notify.error({ title: '提示信息', message: '所选结算单的车辆属性不一致，请维护同一类型车辆属性的结算单！' });
          }
        } else {
          return this.$notify.warning({ title: '提示信息', message: '有未校验通过的信息' });
        }
      }
    },
    async getDetailFun(val) {
      let res = await quyrpBatch(val);
      this.editRow = res.data;
      //发票form赋值
      for (let i in res.data) {
        this.formList.map((x) => {
          if (x.fieldName == i) {
            x.initialValue = res.data[i];
          }
        });
      }
      //快递form赋值
      for (let i in res.data) {
        this.formList1.map((x) => {
          if (x.fieldName == i) {
            x.initialValue = res.data[i];
          }
        });
      }

      //为table赋值(索赔单)
      if (200 == res.resultCode) {
        let data = res.data;
        if (isFormEmpty(data)) {
          data = {};
        }
        let records = data.settleList;
        if (isFormEmpty(records)) {
          records = [];
        }
        this.$refs.table.$refs.pageTable.EXECUTE_INSERT(records);
      }
      //为table赋值(索赔单)
      if (200 == res.resultCode) {
        let data = res.data;
        if (isFormEmpty(data)) {
          data = {};
        }
        let records = data.claimList;
        if (isFormEmpty(records)) {
          records = [];
        }
        this.$refs.table2.$refs.pageTable.EXECUTE_INSERT(records);
        this.$refs.table2.$refs.pageTable.list.map((x) => {
          if(x.ifPrice == '是'){
            x.finalSumAmount =x.priceAmount;
          }
        });
      }
      //为table赋值(考核单)
      if (200 == res.resultCode) {
        let data = res.data;
        if (isFormEmpty(data)) {
          data = {};
        }
        let records = data.assessList;
        if (isFormEmpty(records)) {
          records = [];
        }
        this.$refs.table3.$refs.pageTable.EXECUTE_INSERT(records);
      }
      //为table赋值(审核日志)tableInvoice
      if (200 == res.resultCode) {
        let data = res.data;
        if (isFormEmpty(data)) {
          data = {};
        }
        let records = data.logList;
        if (isFormEmpty(records)) {
          records = [];
        }
        this.$refs.table4.$refs.pageTable.EXECUTE_INSERT(records);
      }
      //为table赋值(发票)
      if (200 == res.resultCode) {
        let data = res.data;
        if (isFormEmpty(data)) {
          data = {};
        }
        let records = data.invoiceList;
        if (isFormEmpty(records)) {
          records = [];
        } else {
          records.map((x) => {
            x.invoiceMoney = x.settleAmount;
            x.invoiceAmout = x.invoiceAmount;
          });
        }
        this.$refs.tableInvoice.$refs.pageTable.EXECUTE_INSERT(records);

        //取出ids
        let ids1 = [];
        this.$refs.tableInvoice.$refs.pageTable.list.map((x) => {
          ids1.push(x.invoiceId);
        });
        // let ids = '';
        // ids1.map((x) => {
        //   ids += x + ',';
        // });
        this.oldInvoiceArr = ids1;
        // console.log(this.delInvoiceIds);
      }
    },
    addInvoice() {
      this.invoiceList = this.$refs.tableInvoice.$refs.pageTable.list;
      this.invoiceShow = true;
    },
    jiesuandanadd() {
      this.jiesuandanFlag = true;
    },
    saveAddInvoice(invoice) {
      this.invoiceMax = invoice.invoiceMax;
      let list = [];
      list.push(invoice);
      // console.log(5555);
      // console.log(list);
      // list.map( x => {
      //   x.invoiceMoney = x.invoiceAmout-x.taxAmount;
      // });
      this.$refs.tableInvoice.$refs.pageTable.EXECUTE_INSERT(list);
      this.invoiceShow = false;
    },
    closeAddInvoice() {
      this.invoiceShow = false;
    },
    onCellChange(columns, row) {
      let sum = 0;
      this.$refs.table.$refs.pageTable.list.map((x) => {
        console.log(x);
        sum += Number(x.pestructionCount);
      });
      console.log(sum);
      this.formList.find((x) => x.fieldName == 'destoryCount').initialValue = sum;
      this.formList.find((x) => x.fieldName == 'cmsClaimCount').initialValue = this.$refs.table.$refs.pageTable.list.length;
    },

    jiesuandanClose() {
      this.jiesuandanFlag = false;
    },
    //结算单新增
    async jiesuandanSave(val) {
      let list = [];
      let pageList = this.$refs.table.$refs.pageTable.list;
      val.map((x) => {
        if (pageList.length == 0) {
          console.log('没有值');
          list.push(x);
        } else {
          if (!pageList.find((f) => f.settleId == x.settleId)) {
            console.log('有值');
            list.push(x);
          }
        }
      });
      this.$refs.table.$refs.pageTable.EXECUTE_INSERT(list);
      this.jiesuandanFlag = false;
      //准备一个容器
      let settleIds = '';
      this.$refs.table.$refs.pageTable.list.map((x) => {
        settleIds += x.settleId + ',';
      });
      let resClaim = await SelectClaimBySettleIds(settleIds);
      let resAsses = await SelectAssesBySettleIds(settleIds);
      //为table赋值(索赔单)
      let records2 = resClaim.data;
      if (isFormEmpty(records2)) {
        records2 = [];
      }
      this.$refs.table2.$refs.pageTable.EXECUTE_DELETE(this.$refs.table2.$refs.pageTable.list);
      this.$refs.table2.$refs.pageTable.EXECUTE_INSERT(records2);

      //为table赋值(考核单)
      let records = resAsses.data;
      if (isFormEmpty(records)) {
        records = [];
      }
      this.$refs.table3.$refs.pageTable.EXECUTE_DELETE(this.$refs.table3.$refs.pageTable.list);
      this.$refs.table3.$refs.pageTable.EXECUTE_INSERT(records);

      // let res= await quyrPSettle(val);
    },
    formChangeHandle(val) {
      this.saveData = val;
    },
    formChangeHandle1(val) {
      this.saveData1 = val;
    },
    //搜索获取数据
    changeHandle(val) {
      this.fetchParams = val;
    },
    //选中
    selectChange(rows) {
      this.selectedRows = rows;
      console.log(this.selectedRows);
    },

    async fapiaodeleteFun(row) {
      this.$refs.tableInvoice.$refs.pageTable.EXECUTE_DELETE([row]);
    },
    async deleteHandle(row) {
      this.$refs.table.$refs.pageTable.EXECUTE_DELETE([row]);
      if (this.$refs.table.$refs.pageTable.list.length == 0) {
        this.$refs.table2.$refs.pageTable.EXECUTE_DELETE(this.$refs.table2.$refs.pageTable.list);
        this.$refs.table3.$refs.pageTable.EXECUTE_DELETE(this.$refs.table3.$refs.pageTable.list);
      } else {
        //准备一个容器
        let settleIds = '';
        this.$refs.table.$refs.pageTable.list.map((x) => {
          settleIds += x.settleId + ',';
        });
        let resClaim = await SelectClaimBySettleIds(settleIds);
        let resAsses = await SelectAssesBySettleIds(settleIds);
        //为table赋值(索赔单)
        let records2 = resClaim.data;
        if (isFormEmpty(records2)) {
          records2 = [];
        }
        this.$refs.table2.$refs.pageTable.EXECUTE_DELETE(this.$refs.table2.$refs.pageTable.list);
        this.$refs.table2.$refs.pageTable.EXECUTE_INSERT(records2);
        //为table赋值(考核单)
        let records = resAsses.data;
        if (isFormEmpty(records)) {
          records = [];
        } //先清除 再重新插入
        this.$refs.table3.$refs.pageTable.EXECUTE_DELETE(this.$refs.table3.$refs.pageTable.list);
        this.$refs.table3.$refs.pageTable.EXECUTE_INSERT(records);
      }
    },
    //取消操作
    closeDialog() {
      this.$emit('close');
    },
    chooseOrderNo() {
      this.visible = true;
    },
    createFormList() {
      return [
        {
          type: 'TEXT_AREA',
          label: '开票备注',
          fieldName: 'invoiceRemarks',
          initialValue: '',
          placeholder: '请输入数量...',
        },
        {
          type: 'TEXT_AREA',
          label: '邮寄说明',
          fieldName: 'expressRemarks',
          initialValue: '',
          placeholder: '请输入数量...',
        },
        // {
        //   type: 'UPLOAD_FILE',
        //   label: '选择文件',
        //   fieldName: 'fileList',
        //   placeholder: '选择文件...',
        //   initialValue: [{ name: 'food.jpeg', fileId: '11',url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100' }],
        //   upload: {
        //     actionUrl: '/api/file/oss/upload',
        //     limit: 2,
        //     tipText: '（支持PDF、RAR、JPG格式）'
        //   }
        // }
      ];
    },
    //table表头和数据源
    creatHeader() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: (props) => {
            return <span>{props.row.index + 1}</span>;
          },
        },
        // {
        //   title: '操作',
        //   dataIndex: 'column-action',
        //   width: 100,
        //   render: (props) => {
        //     return (
        //       <div style="text-align:center">
        //         <multiuse-button size="mini" type="text" onClick={() => this.deleteHandle(props.row)}>
        //           删除
        //         </multiuse-button>
        //       </div>
        //     );
        //   },
        // },
        // { title: '经销商代码', dataIndex: 'dealerCode', sorter: true },
        // { title: '经销商名称', dataIndex: 'dealerName', sorter: true },
        // { title: '结算单号', dataIndex: 'settleNo', sorter: true },
        // { title: '索赔单数', dataIndex: 'claimCount', sorter: true },
        // { title: '结算金额', dataIndex: 'settleAmount', sorter: true },
        // { title: '考核金额', dataIndex: 'assessAmount', sorter: true },
        // { title: '开票时间', dataIndex: 'createdAt', sorter: true }
        { title: '经销商代码', dataIndex: 'ownerCode', sorter: true },
        { title: '经销商名称', dataIndex: 'dealerName', sorter: true },
        { title: '结算单号', dataIndex: 'settleNo', sorter: true },
        { title: '索赔单数', dataIndex: 'claimCount', sorter: true },
        { title: '结算金额', dataIndex: 'settleAmount', sorter: true },
        { title: '考核金额', dataIndex: 'assessAmount', sorter: true },
        { title: '索赔金额', dataIndex: 'claimAmount', sorter: true },
        // { title: '税率', dataIndex: 'taxRate', sorter: true, summation: true },
        // { title: '税额', dataIndex: 'taxAmount', sorter: true },
      ];
    },
    creatHeader1() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: (props) => {
            return <span>{props.row.index + 1}</span>;
          },
        },
        {
          title: '操作',
          dataIndex: 'column-action',
          width: 100,
          render: (props) => {
            return (
              <div style="text-align:center">
                <multiuse-button size="mini" type="text" onClick={() => this.fapiaodeleteFun(props.row)}>
                  删除
                </multiuse-button>
              </div>
            );
          },
        },
        { title: '发票号', dataIndex: 'invoiceNo', sorter: true },
        { title: '开票金额', dataIndex: 'invoiceAmout', sorter: true, summation: true,precision:2 },
        { title: '税率', dataIndex: 'taxRate', sorter: true, summation: true,precision:2 },
        { title: '税额', dataIndex: 'taxAmount', sorter: true, summation: true,precision:2 },
        { title: '金额', dataIndex: 'invoiceMoney', sorter: true, summation: true ,precision:2},
       // { title: '开票时间', dataIndex: 'createAt', sorter: true },
      ];
    },
    //开票备注和附件
    createFormList1() {
      return [
        {
          type: 'INPUT',
          label: '快递单号',
          rules: [{ required: true, message: '请输入快递单号', trigger: 'blur' }],
          fieldName: 'expressNo',
        },
        {
          type: 'INPUT',
          label: '厂家收票人',
          rules: [{ required: true, message: '请输入厂家收票人', trigger: 'blur' }],
          fieldName: 'oemCol',
        },
        {
          type: 'INPUT',
          label: '联系电话',
          rules: [
            { required: true, message: '请输入联系电话', trigger: 'blur' },
            { pattern: /^1[2-9]\d{9}$/, message: '请检查联系电话格式...', trigger: 'blur' },
          ],
          fieldName: 'oemTel',
        },
        {
          type: 'INPUT',
          label: '收票地址',
          rules: [{ required: true, message: '请输入收票地址', trigger: 'blur' }],
          fieldName: 'oemAddress',
        },
        {
          type: 'INPUT',
          label: '开票信息',
          fieldName: 'invoiceInfo',
        },
        {
          type: 'INPUT',
          label: '其他提示',
          fieldName: 'otherRemarks',
        },
      ];
    },

    //索赔单列表
    creatHeader2() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: (props) => {
            return <span>{props.row.index + 1}</span>;
          },
        },
        // {
        //   title: '操作',
        //   dataIndex: 'column-action',
        //   width: 100,
        //   fixed: 'left',
        //   render: props => {
        //     return (
        //       <div style="text-align:center">
        //       <multiuse-button type="primary" icon="el-icon-delete" circle onClick={() => this.deleteFunsuopei(props.row)} />
        //     </div>
        //   );
        //   }
        // },
        { title: '索赔单号', dataIndex: 'claimNo', sorter: true },
        { title: '维修工单号', dataIndex: 'roNo', sorter: true },
        { title: 'VIN', dataIndex: 'vin', sorter: true },
        { title: '车型名称', dataIndex: 'modelName', sorter: true },
        { title: '索赔类型', dataIndex: 'cmsClaimTypeStr', sorter: true },
        { title: '是否一口价', dataIndex: 'ifPrice', sorter: true },
        { title: '索赔金额', dataIndex: 'finalSumAmount', sorter: true },
        { title: '工时费', dataIndex: 'labourFinalPrice', sorter: true },
        { title: '配件费', dataIndex: 'partrFinalPrice', sorter: true },
        { title: '附加费用', dataIndex: 'addFinalPrice', sorter: true },
        { title: '审核时间', dataIndex: 'checkAt', sorter: true },
        { title: '审核人', dataIndex: 'checkBy', sorter: true },
        { title: '主键', dataIndex: 'claimId', hidden: true },
      ];
    },
    //考核单列表
    creatHeader3() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: (props) => {
            return <span>{props.row.index + 1}</span>;
          },
        },
        // {
        //   title: '操作',
        //   dataIndex: 'column-action',
        //   width: 100,
        //   fixed: 'left',
        //   render: props => {
        //     return (
        //       <div style="text-align:center">
        //       <multiuse-button type="primary" icon="el-icon-delete" circle onClick={() => this.deleteFunkaohe(props.row)} />
        //     </div>
        //   );
        //   }
        // },
        { title: '考核单号', dataIndex: 'assessNo', sorter: true },
        { title: '考核类型', dataIndex: 'assessTypeStr', sorter: true },
        { title: '考核金额', dataIndex: 'assessAmount', sorter: true },
        { title: '考核原因', dataIndex: 'assessReason', sorter: true },
        { title: '考核日期', dataIndex: 'assessDate', sorter: true },
        { title: '考核人', dataIndex: 'assessByStr', sorter: true },
        { title: '主键', dataIndex: 'assessId', hidden: true },
      ];
    }, //考核单列表
    creatHeader4() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: (props) => {
            return <span>{props.row.index + 1}</span>;
          },
        },
        { title: '审核人', dataIndex: 'checkBy', sorter: true },
        { title: '审核时间', dataIndex: 'checkAt', sorter: true },
        { title: '审核状态', dataIndex: 'statusStr', sorter: true },
        { title: '审核原因', dataIndex: 'checkRemarks', sorter: true },
      ];
    },
  },
};
</script>

<style lang="less" scoped></style>
